import request  from "@/utils/request.js"

export const mpostlistServer = (params) =>{
    return request.get('/mpost/list',{params:params})
}

export const jiajingServer = (id) =>{
    return request.patch('/mpost/jia/'+id)
}

export const jubaoServer = (id) =>{
    return request.patch('/mpost/jubao/'+id)
}

export const delmpostServer = (id) =>{
    return request.delete('/mpost/del/'+id)
}

export const postlistServer = () =>{
    return request.get('/mpost/post')
}

export const mpostsidServer = (sectionname) =>{
    return request.get('/mpost/mposts/' + sectionname)
}

export const updatampostServer = (mid,Data) =>{
    const params = new URLSearchParams();
    for (let key in Data){
          params.append(key,Data[key]);
    }
    return request.put('/mpost/update/' + mid,params)
}

export const addServer = (addData) =>{
    const params = new URLSearchParams();
    for (let key in addData){
          params.append(key,addData[key]);
    }
    return request.post('/mpost/add',params)
}